home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet Web Designer 86 / PIWD86.iso / pc / contents / dreamweaver / software / dwmx2004.exe / Disk1 / data1.cab / Configuration_En / Commands / Flash Options.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  2.3 KB  |  85 lines

  1. //
  2. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  3. // ----------------------------------------------------
  4. //
  5. // Accessibility.js
  6. //
  7. // This command adds attributes to the flash objects when 
  8. // the preferences for accessibility are checked.
  9. //
  10. // Version 1.0
  11. // Functions:
  12. //
  13. // addAccessibilityAttrib: sets the attributes to the object selected by Flash Text.js or Flash Button.js
  14. // receives: dom of document with flash object, and attributes from Flash Options.htm
  15. // returns: nothing 
  16. // ----------------------------------------------------
  17.  
  18.  
  19. var globalFormItem;
  20. var helpDoc = MM.HELP_objFlashAccessOptions;
  21.  
  22. function commandButtons() {
  23.    return new Array(MM.BTN_OK,         "addAccessibilityAttrib();window.close()",
  24.                     MM.BTN_Cancel,     "window.close()",
  25.                     MM.BTN_Help,       "displayHelp()"    );
  26.  
  27.  
  28. }
  29.  
  30. function isDOMRequired() { 
  31.     // Return false, indicating that this object is available in code view.
  32.     return false;
  33. }
  34.  
  35. function setFormItem(formItem) {
  36.  
  37.     globalDom = formItem;
  38. }
  39.  
  40. function addAccessibilityAttrib()
  41. {
  42.  
  43.     var title='', tabindex='', accesskey='',objStr='' ;
  44.  
  45.     var docDom= globalDom; 
  46.     var objtag= docDom.getSelectedNode();
  47.  
  48.  
  49.     var objFile = dreamweaver.getConfigurationPath() + "/Commands/Flash Options.htm";
  50.     var objDOM = dreamweaver.getDocumentDOM(objFile);
  51.     
  52.     title= objDOM.theForm.title.value;
  53.     tabindex= objDOM.theForm.tabindex.value;
  54.     accesskey= objDOM.theForm.accesskey.value;
  55.  
  56.     if (accesskey != '') docDom.setAttribute('accesskey', accesskey);
  57.     if (tabindex != '') docDom.setAttribute('tabindex', tabindex);
  58.     if (title != '') docDom.setAttribute('title', title);
  59.  
  60. }
  61.  
  62. function initializeUI()
  63. // populate dialog attributes if defined
  64. {
  65.  
  66.     var docDom= globalDom; 
  67.     var objtag= docDom.getSelectedNode();
  68.  
  69.     var objFile = dreamweaver.getConfigurationPath() + "/Commands/Flash Options.htm";
  70.     var objDOM = dreamweaver.getDocumentDOM(objFile);
  71.  
  72.     var title='', tabindex='', accesskey='',objStr='' ;
  73.  
  74.     title= objtag.getTranslatedAttribute('title');
  75.     if (title) objDOM.theForm.title.value= title;
  76.  
  77.     tabindex= objtag.getTranslatedAttribute('tabindex');
  78.     if (tabindex) objDOM.theForm.tabindex.value= tabindex;
  79.  
  80.     accesskey= objtag.getTranslatedAttribute('accesskey');
  81.     if (accesskey) objDOM.theForm.accesskey.value= accesskey;
  82.     
  83. }
  84.  
  85.